# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-pyqrcode
_gitcommit=674a77b5eaf850d063f518bd90c243ee34ad6b5d
pkgver=1.2.1
pkgrel=0
pkgdesc="Python 3 module to generate QR Codes"
url="https://github.com/mnooner256/pyqrcode/"
arch="noarch"
license="BSD-3-Clause"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-nose py3-pypng"
subpackages="$pkgname-doc $pkgname-pyc"
source="py3-pyqrcode-$pkgver.tar.gz::https://github.com/mnooner256/pyqrcode/archive/$_gitcommit.tar.gz"
builddir="$srcdir/pyqrcode-${_gitcommit}"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	nosetests -sv tests
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
87a307e57d470153b37cccd3e79c8e04fc8de63cc7ffce313a7cc7d7e7f53b2979125ac3680a4b261fe0eeffd476e7934fa189a679f9370d690113811cc750b8  py3-pyqrcode-1.2.1.tar.gz
"
